@extends('layouts.app')

@section('content')
<!-- Main content -->
<section class="content">
  <div class="row">
    <div class="col-xs-12">
      @include('layouts.utils.success')
      <div class="box">
        <div class="box-header">
          活动总数：{{ $activities->total() }}
        </div>
        <!-- /.box-header -->
        <div class="box-body table-responsive no-padding">
          <table class="table table-hover">
            <tr>
              <th style="width: 50px;">ID</th>
              <th>活动名</th>
              <th>主题</th>
              <th>用户</th>
              <th>申请人数</th>
              <th>加入人数</th>
              <th>评论数</th>
              <th>发布日期</th>
              <th style="width: 50px;">操作</th>
            </tr>
            @forelse($activities as $activity)
            <tr>
              <td>{{ $activity->id }}</td>
              <td>
                <a href="{{ url('/api_admin/activities/'.$activity->id) }}">
                  {{ $activity->title }}
                </a>
              </td>
              <td>{{ $activity->theme }}</td>
              <td>
                <a href="{{ url('/api_admin/users/'.$activity->user_id) }}">
                  {{ $activity->user_name }}
                </a>
              </td>
              <td>{{ $activity->activity_apply_count }}</td>
              <td>{{ $activity->activity_join_count }}</td>
              <td>{{ $activity->activity_comment_count }}</td>
              <td>{{ $activity->created_at }}</td>
              <td>
                <a style="cursor: pointer;" data-toggle="modal" data-target="#delete">删除</a>
              </td>
            </tr>
            @empty
              <tr>
                <td colspan="6" class="text-center">暂无数据</td>
              </tr>
            @endforelse
          </table>
        </div>
        <div class="box-footer">
          {!! $activities->links() !!}
        </div>
        <!-- /.box-body -->
      </div>
      <!-- /.box -->
    </div>
  </div>
  <div class="modal fade" id="delete">
    <div class="modal-dialog" role="document">
      <div class="modal-content">
        <div class="modal-header">
          <button type="button" class="close" data-dismiss="modal" aria-label="Close">
            <span aria-hidden="true">&times;</span>
          </button>
          <h4 class="modal-title">删除这个活动</h4>
        </div>
        <div class="modal-body">
          <form role="form">
            <div class="box-body">
              <div class="form-group">
                <label for="sign">输入删除理由</label>
                <input type="text" class="form-control" id="sign" placeholder="删除理由">
              </div>
            </div>
          </form>
        </div>
        <div class="modal-footer">
          <button type="button" class="btn btn-default pull-left" data-dismiss="modal">取消</button>
          <button type="button" class="btn btn-danger">确认删除</button>
        </div>
      </div>
    </div>
  </div>
</section>
<!-- /.content -->
@endsection
